Posted On: Jun 22, 2023

Serverless application developers can now build AppSync powered applications in AWS Serverless Application Model (AWS SAM) with the new AWS::Serverless::GraphQLApi resource abstraction. AWS AppSync is a managed service that makes it easier to build scalable APIs that connect applications to data with a GraphQL endpoint. Before today, SAM customers had to work through a learning curve while building their AppSync applications in a SAM template:

  1. SAM customers wanting to use AppSync could only use AppSync’s CloudFormation resources in their SAM template.
  2. IAM permissions had to be managed individually by the user, requiring IAM expertise to successfully and safely integrate the AppSync resources with Lambda or DynamoDB.

Now, SAM customers can use the AWS::Serverless::GraphQLApi resource type to simplify defining an AppSync GraphQL API. With a single resource, everything necessary can be provided for a typical AppSync GraphQL API definition, including the API schema, the resolver pipeline functions, and data sources. SAM CLI support is also included to allow the API schemas, resolvers, and pipeline functions code files automatically packaged and uploaded to S3.

You can use the AWS::Serverless::GraphQLApi resource today in your Serverless Application Model (SAM) template. Available in all AWS commercial regions, except China and GovCloud.

To get started, please see documentation on using the AWS::Serverless::GraphQLApi resource type in your AWS SAM template.